package com.rainwood.water_authority.ui.adapter;

import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.rainwood.water_authority.R;
import com.rainwood.water_authority.base.MyBaseAdapter;
import com.rainwood.water_authority.http.response.InventoryHomeBean;
import com.rainwood.water_authority.http.response.PanDianListBean;
import com.sxs.tools.utils.DateTimeUtil;

/**
 * @author sxs
 * @date :2020/9/28
 * @desc: 盘点适配器
 */
public final class InventoryBaseAdapter extends MyBaseAdapter<PanDianListBean.DataBean.InfoBean> {

    public InventoryBaseAdapter(@NonNull Context context) {
        super(context);
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder();
    }

    private class ViewHolder extends MyBaseAdapter.ViewHolder {

        private final TextView tv_orderNo;
        private final TextView tv_date, tv_name;

        public ViewHolder() {
            super(R.layout.item_dianpan);
            tv_orderNo = (TextView) findViewById(R.id.tv_orderNo);
            tv_date = (TextView) findViewById(R.id.tv_date);
            tv_name = (TextView) findViewById(R.id.tv_name);
        }

        @SuppressLint("SetTextI18n")
        @Override
        public void onBindView(int position) {
            tv_orderNo.setText(getItem(position).getOrderNo());
            tv_date.setText(getItem(position).getDate());
            tv_name.setText(getItem(position).getName());
        }
    }
}
